package fina2.dcs.returns;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import fina2.dcs.upload.UploadType;

@Entity
@SuppressWarnings("serial")
@Table(name = "IN_IMPORTED_RETURNS")
public class ImportReturn implements Serializable {
	private int id;
	private String returnCode;
	private String bankCode;
	private String versionCode;
	private Date periodStart;
	private Date periodEnd;
	private int langId;
	private int userId;
	private Date uploadTime;
	private Date importStart;
	private Date importEnd;
	private int status;
	

	private byte[] content;
	private String message;
	private UploadType type;
	private long xlsId;

	public ImportReturn() {

	}

	public ImportReturn(String returnCode, Date importStart, Date importEnd, int status, String versionCode, UploadType type, String message) {
		this.returnCode = returnCode;
		this.versionCode = versionCode;
		this.importStart = importStart;
		this.importEnd = importEnd;
		this.status = status;
		this.message = message;
		this.type = type;
	}

	public ImportReturn(int id, String returnCode, String bankCode, String versionCode, Date periodStart, Date periodEnd, int userId, Date uploadTime, Date importStart, Date importEnd, int status, byte[] content, String message, UploadType type) {
		this.id = id;
		this.returnCode = returnCode;
		this.bankCode = bankCode;
		this.versionCode = versionCode;
		this.periodStart = periodStart;
		this.periodEnd = periodEnd;
		this.userId = userId;
		this.uploadTime = uploadTime;
		this.importStart = importStart;
		this.importEnd = importEnd;
		this.status = status;
		this.content = content;
		this.message = message;
		this.type = type;
	}

	@Id
	public int getId() {
		return id;
	}

	public String getReturnCode() {
		return returnCode;
	}

	public String getBankCode() {
		return bankCode;
	}

	public String getVersionCode() {
		return versionCode;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getPeriodStart() {
		return periodStart;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getPeriodEnd() {
		return periodEnd;
	}

	public int getUserId() {
		return userId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getUploadTime() {
		return uploadTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getImportStart() {
		return importStart;
	}

	@Temporal(TemporalType.TIMESTAMP)
	public Date getImportEnd() {
		return importEnd;
	}

	public int getStatus() {
		return status;
	}

	public byte[] getContent() {
		return content;
	}

	public String getMessage() {
		return message;
	}

	@Enumerated(EnumType.ORDINAL)
	public UploadType getType() {
		return type;
	}

	public long getXlsId() {
		return xlsId;
	}

	public int getLangId() {
		return langId;
	}

	public void setLangId(int langId) {
		this.langId = langId;
	}

	public void setXlsId(long xlsId) {
		this.xlsId = xlsId;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setReturnCode(String returnCode) {
		this.returnCode = returnCode;
	}

	public void setBankCode(String bankCode) {
		this.bankCode = bankCode;
	}

	public void setVersionCode(String versionCode) {
		this.versionCode = versionCode;
	}

	public void setPeriodStart(Date periodStart) {
		this.periodStart = periodStart;
	}

	public void setPeriodEnd(Date periodEnd) {
		this.periodEnd = periodEnd;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public void setUploadTime(Date uploadTime) {
		this.uploadTime = uploadTime;
	}

	public void setImportStart(Date importStart) {
		this.importStart = importStart;
	}

	public void setImportEnd(Date importEnd) {
		this.importEnd = importEnd;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public void setContent(byte[] content) {
		this.content = content;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public void setType(UploadType type) {
		this.type = type;
	}
	
	@Override
	public String toString() {
		return "ImportReturn [id=" + id + ", returnCode=" + returnCode + ", bankCode=" + bankCode + ", versionCode=" + versionCode + ", periodStart=" + periodStart + ", periodEnd=" + periodEnd + ", userId=" + userId + ", uploadTime=" + uploadTime + ", importStart=" + importStart + ", importEnd=" + importEnd + ", status=" + status + ", message=" + message + ", type=" + type + "]";
	}
}
